import request from "../http";

/**
 * 楼宇首页 investment
 */

// 获取热门楼宇列表
export function getInvestmentList(query) {
  return request({
    url: `/building/investment/info/recommendationList`,
    method: "GET",
    params: query
  });
}
/**
 * 楼宇动态 investment
 */
// 获取楼宇动态列表
export function getDynamicsList(query) {
  return request({
    url: "/building/investment/dynamics/list",
    method: "GET",
    params: query
  });
}
/**
 * 楼宇动态详情 investmenDynamictDetails
 */

// 获取楼宇动态详情
export function getDynamicsDetails(id) {
  return request({
    url: "/building/investment/dynamics/get/" + id,
    method: "GET"
  });
}
// 获取关联楼宇列表
export function getAssociatedBuilding(query) {
  return request({
    url: "/building/investment/dynamics/relatedBuildingList",
    method: "GET",
    params: query
  });
}
// 获取更多动态列表
export function getDynamicsRecomendList(query) {
  return request({
    url: "/building/investment/dynamics/recommendationList",
    method: "GET",
    params: query
  });
}

/**
 * 楼宇列表 investmentList
 */
// 查询用户是否已经联系过此楼宇
export function getCheckBuildingIsContactedForUser(query) {
  console.log('query', query)
  return request({
    url: `/building/investment/intendedUser/checkBuildingIsContactedForUser`,
    method: "GET",
    params: query
  });
}
// 联系楼宇的提交接口
export function getVerifyAuthCode(data) {
  return request({
    url: "/building/investment/intendedUser/verifyAuthCode",
    method: "POST",
    data
  });
}
// 联系楼宇的获取手机验证码
export function getSendAuthCode(data) {
  return request({
    url: "/building/investment/intendedUser/sendAuthCode",
    method: "POST",
    data
  });
}
// 楼宇列表
export function getInfoList(data,obj) {
  let { pageNum, pageSize} = obj
  return request({
    url: `/building/investment/info/list?pageNum=${pageNum}&pageSize=${pageSize}`,
    method: "POST",
    data
  });
}
/**
 * 楼宇详情 investmentdetails
 */
// 获取楼宇详情
export function getInvestmentInfo(id) {
  return request({
    url: "/building/investment/info/get/" + id,
    method: "GET"
  });
}
// 关联政策列表
export function getPolicyListByBuildingInfoId(query) {
  return request({
    url: "/building/investment/relatedPolicy/getPolicyListByBuildingInfoId",
    method: "GET",
    query
  });
}

/**
 * 楼宇业主入驻 investmentSettled
 */

 // 楼宇业主入驻提交
export function getOwnerAuthRegister(data) {
  return request({
    url: "/building/investment/ownerAuth/register",
    method: "POST",
    data
  });
}
// 楼宇业主认证信息
export function getOwnerAuthUserAuthInfo(query) {
  return request({
    url: "/building/investment/ownerAuth/getUserAuthInfo",
    method: "GET",
    query
  });
}